package com.yy.micro.magic.rest;

import com.yy.micro.magic.core.context.MagicCubeEngine;
import com.yy.micro.magic.core.domain.MagicRequest;
import com.yy.micro.magic.core.domain.MagicResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(value = "测试魔方数据变换",produces = "YY")
@RestController
@RequestMapping("magic-cube")
public class MagicCubeRestful {

    @Autowired
    private MagicCubeEngine engine;

    @ApiOperation(value = "Test data magic trans.",notes = "test magic cube data ")
    @PostMapping("json")
    public MagicResponse execute(@RequestBody MagicRequest request){
        return engine.execute(request);
    }
}
